{set:$seller_id = $this->seller['seller_id']}
{set:$searchParam = http_build_query(Util::getUrlParam('search'))}
{set:$condition = Util::search(IReq::get('search'));$where = $condition ? " and ".$condition : "";}

<article class="module width_full">
	<header>
		<h3 class="tabs_involved">订单列表</h3>
		<ul class="tabs">
			<li><input type="button" class="alt_btn" onclick="filterResult();" value="检索" /></li>
			<li><input type="button" class="alt_btn" onclick="window.open('{url:/seller/order_report/?$searchParam}')" value="导出Excel" /></li>
		</ul>
	</header>

	<table class="tablesorter" cellspacing="0">
		<colgroup>
			<col width="145px" />
			<col width="85px" />
			<col width="115px" />
			<col width="125px" />
			<col width="125px" />
			<col width="155px" />
			<col width="75px" />
			<col />
		</colgroup>

		<thead>
			<tr>
				<th>订单号</th>
				<th>收货人</th>
				<th>联系电话</th>
				<th>配送状态</th>
				<th>支付状态</th>
				<th>下单时间</th>
				<th>打印</th>
				<th>操作</th>
			</tr>
		</thead>

		<tbody>
			{set:$page = IReq::get('page') ? IFilter::act(IReq::get('page'),'int') : 1}
			{query:name=order_goods as og join=left join goods as go on go.id eq og.goods_id left join order as o on o.id eq og.order_id fields=o.* page=$page where=go.seller_id eq $seller_id and o.if_del eq 0 and o.status neq 4 $where id=$orderObject}
			<tr>
				<td title="{$item['order_no']}">{$item['order_no']}</td>
				<td title="{$item['accept_name']}">{$item['accept_name']}</td>
				<td title="{$item['mobile']}">{$item['mobile']}</td>
				<td><span name="disStatusColor{$item['distribution_status']}">{echo:Order_class::getOrderDistributionStatusText($item)}</span></td>
				<td>
					<span name="payStatusColor{$item['pay_status']}">
					{if:$item['pay_type']==0}货到付款{/if}
					&nbsp;&nbsp;
					{echo:Order_class::getOrderPayStatusText($item)}
					</span>
				</td>
				<td title="{$item['create_time']}">{$item['create_time']}</td>
				<td>
					<span class="prt" title="购物清单打印" onclick="window.open('{url:/order/shop_template/id/$item[id]/seller_id/$seller_id}');">购</span>
					<span class="prt" title="配货单打印" onclick="window.open('{url:/order/pick_template/id/$item[id]/seller_id/$seller_id}');">配</span>
					<span class="prt" title="联合打印" onclick="window.open('{url:/order/merge_template/id/$item[id]/seller_id/$seller_id}');">合</span>
					<span class="prt" title="快递单打印" onclick="window.open('{url:/order/expresswaybill_template/id/$item[id]}');">递</span>
				</td>
				<td>
					<a href="{if:Order_class::isGoDelivery($item)}{url:/seller/order_deliver/id/$item[id]}{else:}javascript:alert('此单不满足发货条件');{/if}"><img class="operator" src="{skin:images/main/icn_jump_back.png}" title="立即发货" alt="立即发货" /></a>
					<a href="{url:/seller/order_show/id/$item[id]}"><img title="订单详情" alt="订单详情" src="{skin:images/main/icn_settings.png}" /></a>
				</td>
			</tr>
		   {/query}
		</tbody>
	</table>
    {$orderObject->getPageBar()}
</article>

<script type="text/html" id="orderTemplate">
<form action="{url:/}" method="get" name="filterForm">
	<input type='hidden' name='controller' value='seller' />
	<input type='hidden' name='action' value='order_list' />
	<div class="module_content">
		<fieldset>
			<label>订单号</label>
			<input name="search[order_no=]" value="" type="text" />
		</fieldset>
		<fieldset>
			<label>收货人</label>
			<input name="search[accept_name=]" value="" type="text" />
		</fieldset>
		<fieldset>
			<label>选择支付状态</label>
			<select name="search[pay_status=]">
				<option value="">全部</option>
				<option value="0">未支付</option>
				<option value="1">已支付</option>
				<option value="2">退款成功</option>
			</select>
		</fieldset>
		<fieldset>
			<label>选择发货状态</label>
			<select name="search[distribution_status=]">
				<option value="">全部</option>
				<option value="0">未发货</option>
				<option value="1">已发货</option>
				<option value="2">部分发货</option>
			</select>
		</fieldset>
		<fieldset>
			<label>订单状态</label>
			<select name="search[status=]">
				<option value="">全部</option>
				<option value="1">新订单</option>
				<option value="2">确认订单</option>
				<option value="3">取消订单</option>
				<option value="4">作废订单</option>
				<option value="5">完成订单</option>
			</select>
		</fieldset>
    </div>
</form>
</script>
<script type='text/javascript'>

//检索商品
function filterResult()
{
	var ordersHeadHtml = template.render('orderTemplate');
	art.dialog(
	{
		"init":function()
		{
			var filterPost = {echo:JSON::encode(IReq::get('search'))};
			var formObj = new Form('filterForm');
			for(var index in filterPost)
			{
				formObj.setValue("search["+index+"]",filterPost[index]);
			}
		},
		"title":"检索条件",
		"content":ordersHeadHtml,
		"okVal":"立即检索",
		"ok":function(iframeWin, topWin)
		{
			iframeWin.document.forms[0].submit();
		}
	});
}

//DOM加载结束
$(function(){
	//高亮色彩
	$('[name="payStatusColor1"]').addClass('green');
	$('[name="disStatusColor1"]').addClass('green');
});
</script>